<template>
  <!-- 大触周边页面 -->
  <div class="Product">
    <div class="Pro_item" v-for="item in productList" :key="item.id">
      <img :src="`https://ss.lanqb.com/${item.imgCover}`" />
      <h4>{{ item.merch.title }}</h4>
      <div class="tx">
        <img :src="`https://ss.lanqb.com/${item.profile.avatar}`" alt="" />
        <span>{{ item.profile.nickname }}</span>
      </div>
      <span class="price">￥{{ item.merch.sale_rmb_price }}</span>
      <div class="button">立即购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ProductView",

  data() {
    return {
      productList: [],
    };
  },
  async created() {
    const {
      data: { data },
    } = await this.$http({
      methods: "Get",
      url: "/lqb/api/daniu/interview",
      params: {
        link: "paging",
        type: "merch",
        limit: 12,
        page: 1,
      },
    });
    this.productList = data;
    console.log(this.productList);
  },
  mounted() {},

  methods: {},
};
</script>

<style lang="scss" scoped>
.Product {
  width: 100vw;
  box-sizing: border-box;
  margin-bottom: 24px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  background: #f4f4f4;
  .Pro_item {
    .button {
      color: #634b19;
      background-color: #edce8c;
      cursor: pointer;
      border: none;
      display: inline-block;
      background-image: none;
      height: 24px;
      line-height: 24px;
      width: 70px;
      text-align: center;
      border-radius: 25px;
      font-weight: 400;
      font-size: 13px;
      bottom: 13px;
      right: 20px;
      position: absolute;
    }
    position: relative;
    background-color: #fff;
    border-radius: 5px;
    margin: 5px;
    display: flex;
    width: 170px;
    height: 284px;
    flex-direction: column;
    img {
      width: 170px;
      border-top-right-radius: 5px;
      border-top-left-radius: 5px;
      height: 170px;
    }
    h4 {
      font-size: 12px;
      text-overflow: -o-ellipsis-lastline;
      overflow: hidden; //溢出内容隐藏
      text-overflow: ellipsis; //文本溢出部分用省略号表示
      display: -webkit-box; //特别显示模式
      -webkit-line-clamp: 2; //行数
      line-clamp: 2;
      -webkit-box-orient: vertical; //盒子中内容竖直排列
    }
    .tx {
      display: flex;
      align-items: center;
      img {
        width: 17px;
        height: 17px;
        border-radius: 50%;
        margin: 5px;
      }
    }
    .price {
      color: #ff7b7c;
      margin: 20px 5px 5px 5px;
    }
  }
}
</style>
